package basetest.wsf

/**
  * Created by shouf on 2016/5/8.
  */
class objecttest {
  private def test = {
    /**
      * 内部函数
      */
    def test: Unit ={
      val data  = 3
      data match {
        case i: Int if i > 20 => println(i)
        case _ => println("")
      }
      def matchmethod(list : List[Int]): Unit ={
        list match {
          case 0::nill => println("0" + nill)
          case 1::till => println("till")
          case x::y => println("x y")
          case _ => println("   ")
        }
      }
      matchmethod(List(0,1))
      println("test in test")
    }

    val test2 = (x:String) => println(x)
    test
    test2("10")

    def sum(a:Int, b:Int, c:Int) = (a + b + c)
    val fp_a = sum _
    println(fp_a(1, 2, 3))
    println(fp_a.apply(1, 2, 3))

    val fp_b = sum(_ : Int, 1, 2)
    println(fp_b(2))
  }
//  objecttest.ot
}

object objecttest{
  private val ot = new objecttest
  ot.test
}

object Main extends App {
  objecttest
}
